﻿using System;
using System.ComponentModel.DataAnnotations;
using CommunityToolkit.Mvvm.ComponentModel;
using SqlSugar;

namespace AvaloniaApplicationDemo.DTO;

public partial class ModbusReportModel: ObservableObject
{
    // /// <summary>
    // /// 主键
    // /// </summary>
    [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] // SqlSugar 主键特性
    public int Id { get; set; }
    
    /// <summary>
    /// 设备名称
    /// </summary>
    [ObservableProperty]
    private string? _deviceName;
    /// <summary>
    /// 报表时间
    /// </summary>
    [ObservableProperty]
    private DateTime _rePortTime = DateTime.Now;
    /// <summary>
    /// 输出电流
    /// </summary>
    [ObservableProperty]
    private uint _outputAH;
    /// <summary>
    /// 输出电量
    /// </summary>
    [ObservableProperty]
    private uint _outputWh;
    /// <summary>
    /// 测试时间
    /// </summary>
    [ObservableProperty]
    private string _outputTime;
    
    [ObservableProperty]
    private string _reportType;
    
    
    public ModbusReportModel(int id,string deviceName, DateTime rePortTime, uint outputAH, uint outputWh, string outputTime,string reportType)
    {
        Id = id;
        DeviceName = deviceName;
        RePortTime = rePortTime;
        OutputAH = outputAH;
        OutputWh = outputWh;
        OutputTime = outputTime;
        ReportType = reportType;
    }
    
    public ModbusReportModel()
    {
        
    }
}